// import Vue from 'vue'
import Router from 'vue-router'
import ArticleView from './views/ArticleView.vue'
import CommentView from './views/CommentView.vue'
import UserView from './views/UserView.vue'
import LoginView from './views/LoginView.vue'
import DemoHomeView from './views/DemoHomeView.vue'
import AdvanceDemosView from './views/demos/AdvanceDemosView.vue'
import BasicDemosView from './views/demos/BasicDemosView.vue'
import FullDemosView from './views/demos/FullDemosView.vue'

Vue.use(Router)


export default new Router({
  // mode: 'abstract',
  routes: [
    { path: '/article/:url(.*)?', component: ArticleView },
    { path: '/item/:id(\\d+)', component: CommentView },
    { path: '/user/:id', component: UserView },
    { path: '/login', component: LoginView },
    {
      path: '/demos',
      component: DemoHomeView,
      children: [
        { path: '', component: BasicDemosView },
        { path: 'basic', component: BasicDemosView },
        { path: 'advance', component: AdvanceDemosView },
        { path: 'full', component: FullDemosView }
      ]
    },
    { path: '/', redirect: '/demos' }
  ]
})
